<?php
/**
 * Created by PhpStorm.
 * User: zhu_hbo
 * Date: 16/10/8
 * Time: 下午2:13
 */

$x=5;// 全局变量

/**
 *
 */
function myTest()
{
    //global $x;
    //$x+=10;

    $GLOBALS['x'] +=10;

    static $z = 11;
    $y=10; // 局部变量
    echo "<p>测试函数内变量:<p>";
    echo "变量 x 为: ".$GLOBALS['x'];
    echo "<br>";
    echo "变量 y 为: $y";
}

myTest();

echo "<p>测试函数外变量:<p>";
echo "变量 x 为: $x";
echo "<br>";
echo "变量 y 为: $y";
echo "<br>";

$a = "h";
$b = $a+8;
echo $b;

?>
